import request from '@/utils/request.js'

const medicineApi = {
    selectAll() {
        return request.get('/medicine/selectAll')
    },
    list(medicineQuery) {
        return request.get('/medicine/list', {params: medicineQuery})
    },
    deleteById(id) {
        return request.delete(`/medicine/deleteById/${id}`)
    },
    deleteAll(ids) {
        return request.delete(`/medicine/deleteAll/${ids}`)
    },
    add(medicine) {
        return request.post(`/medicine/add`, medicine)
    },
    selectById(id) {
        return request.get(`/medicine/selectById/${id}`)
    },
    update(medicine) {
        return request.put(`/medicine/update`, medicine)
    },
    selectQuantity(medicineId) {
        return request.get(`/medicine/selectQuantity/${medicineId}`)
    },
    exportExcel() {
        return request({
            url: '/medicine/exportExcel',
            method: 'get',
            responseType: 'blob'
        })
    }
}

export default medicineApi